<!DOCTYPE html>
<html>
<body>
<form>
  <input type="file" name="file" multiple id="file">
</form>
<p>The file upload control above should have text '2 files,' not a filename.</p>

<script>
function startTest()
{
    var input = document.getElementById('file');

    // Drop 2 files to the control.
    eventSender.beginDragWithFiles(['input-file-re-render.html', 'script-tests/TEMPLATE.html']);
    eventSender.mouseMoveTo(10, 10);
    eventSender.mouseUp();

    // Move the mouse away before moving on. This is done because landing the patch for bug 249328
    // would cause this test to fail. That patch fixes a hover problem which causes this test
    // to actually perform correctly (after switching back to display: inline-block, the style of 
    // the file control would be 'hovered', since it's under the mouse). However, the 'expected'
    // PNG files were created when this was not working properly, and the control is in its un-hovered state.
    eventSender.mouseMoveTo(300, 300);

    // Delete the renderer.
    input.style.display = 'none';
    input.offsetWidth; // Force to do layout

    // Attach a renderer again.
    input.style.display = 'inline-block';

    testRunner.notifyDone();
}

if (window.eventSender) {
    window.onload = startTest;
    testRunner.waitUntilDone();
}
</script>
</body>
</html>
